<template>
  <div style="width: 100%; height: 100%">
    <el-image style="width: 100%; height: 100%"
        :preview-src-list="option.attribute.preview ? [option.attribute.url]:[]"
        :src="option.attribute.url ? getFullFilePath(option.attribute.url) :require('@/assets/logo.png')" :fit="option.attribute.fit"/>
  </div>
</template>

<script>
import {fileUrl} from "/env";
import { getFile } from '@/api/ImgPool';
export default {
  name: "cpt-image",
  props: {option: Object},
  data() {
    return {
      fileUrl:fileUrl,
    }
  },
  methods:{
    getFullFilePath(str){
      return getFile(str); 
    },
  }
}
</script>

<style scoped>
</style>
